import { TreeItem } from '/@/components/Tree/index';

import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { useUserStore } from '/@/store/modules/user';
const userStore = useUserStore();
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '班组编码',
    align: "center",
    dataIndex: 'orgCode'
  },
  {
    title: '班组名称',
    align: "center",
    dataIndex: 'orgName'
  },
  {
    title: '系数名称',
    align: "center",
    dataIndex: 'xsName'
  },
  {
    title: '系数编码',
    align: "center",
    dataIndex: 'xsCode'
  },
  {
    title: '排序',
    align: "center",
    dataIndex: 'displayOrder'
  },
  {
    title: '描述',
    align: "center",
    dataIndex: 'remark'
  },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    field: 'orgCode',
    component: 'Select',
    label: '班组1',
    componentProps: {
      options: userStore.getTeamList,
    },
    defaultValue: userStore.getOrgCode,
    colProps: { span: 6, },
  },
];

//查询数据
export const searchFormSchemaTest: FormSchema[] = [
  {
    field: 'orgCode',
    component: 'Select',
    label: '班组1',
    componentProps: {
      options: userStore.getTeamList,
    },
    defaultValue: userStore.getOrgCode,
    colProps: { span: 6, },
  },
  {
    field: 'jdst',
    component: 'JDictSelectTag',
    label: '性别字典',
    helpMessage: ['component模式'],
    componentProps: { dictCode: 'sex' },
    colProps: { span: 6, },
  },
  {
    field: 'jdst2',
    component: 'JDictSelectTag',
    label: '任意表',
    // helpMessage: ['component模式'],
    // componentProps: { dictCode: "test_category,name,id,sex!='2' order by id" },
    colProps: { span: 6, },
  },
  {
    field: 'jsst',
    component: 'JSearchSelect',
    label: '字典搜索',
    componentProps: {
      mode: 'multiple',   //多选
      dictOptions: [
        { text: '选项一', value: '1', },
        { text: '选项二', value: '2', },
        { text: '选项三', value: '3', },
      ],
    },
    colProps: { span: 6 },
  },
  {
    label: '本地搜索',
    field: 'selectInput',
    component: 'JSelectInput',
    componentProps: {
      options: [
        { label: '选项一', value: '1' },
        { label: '选项二', value: '2' },
        { label: '选项三', value: '3' },
      ],
    },
    colProps: { span: 6 },
  },
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '班组编码',
    field: 'orgCode',
    component: 'Input',
    dynamicDisabled: () => true,
  },
  {
    label: '班组名称',
    field: 'orgName',
    component: 'Input',
    dynamicDisabled: () => true,
  },
  {
    label: '系数名称',
    field: 'xsName',
    component: 'Input',
  },
  {
    label: '系数编码',
    field: 'xsCode',
    component: 'Input',
  },
  {
    label: '排序',
    field: 'displayOrder',
    component: 'InputNumber',
  },
  {
    label: '描述',
    field: 'remark',
    component: 'InputTextArea',
  },
  // TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false
  },
];
